
import {log} from './urlconfig/config.js';

    var edition = localStorage.getItem("edition");
    var channel = localStorage.getItem("channel");
    var sys = localStorage.getItem("sys");
    var cpuid = localStorage.getItem("cpuid");

/*关闭按钮日志*/
function close(name){
    $.ajax({
        type:'GET',
        url:log+ name+'/'+ channel+'/'+ edition + '/'+sys+'/'+cpuid,
        dataType: 'json',
        success:function(res) {
            if(res.code==200){
                console.log(res.msg)

            }
        },
        error:function(err) {
            console.log(err)
        }
    });
}

/*页面显示日志*/
var main;
if($("#fagepage").length>0){
    main=$("#fagepage").val();
}
$.ajax({
    type:'GET',
    url:log+ main+'/'+ channel+'/'+ edition + '/'+sys+'/'+cpuid,
    dataType: 'json',
    success:function(res) {
        if(res.code==200){
            console.log(res.msg)

        }
    },
    error:function(err) {
        console.log(err)
    }
});


$(".mall-close").click(function () {
    var btnlog=$(this).attr('data-log');
    var int=$(this).attr('data-into');
    close(btnlog);
    if('Widget' in window){
        Widget.slotCloseWindow(int)
    }
});

/*点击kefu*/

$("#kefu").click(function (){
    if('Widget' in window){
        Widget.slotOpenExternalBrowser('http://office.zhuazi.com/kefu.html');
    }
});
document.oncontextmenu = function(){
    return false;
};
$(document).keydown(function(event){
    //屏蔽 Alt+ 方向键 ←
    //屏蔽 Alt+ 方向键 →
    if ((event.altKey)&&((event.keyCode==37)||(event.keyCode==39)))
    {
        event.returnValue=false;
        return false;
    }
    //屏蔽退格删除键
    if(event.keyCode==8){
        return false;
    }
    //屏蔽F5刷新键
    if(event.keyCode==116){
        return false;
    }
    //屏蔽alt+R
    if((event.ctrlKey) && (event.keyCode==82)){
        return false;
    }
});
var img=$("img");
img.on("contextmenu",function(){return false;});
img.on("dragstart",function(){return false;});